<template>
	<view class="container">
		<!-- 顶部导航栏 -->
		<u-navbar
			title="合同签约"
			:autoBack="true"
			:fixed="true"
			:bgColor="'#ffffff'"
			:placeholder="true"
			:titleStyle="{
				color: '#333',
				fontSize: '16px',
			}"
		>
			<template #right>
				<text class="nav-right">电子合同</text>
			</template>
		</u-navbar>

		<!-- 表单内容 -->
		<view class="form-content">
			<!-- 合同类型 -->
			<view class="form-title">
				<view class="title">合同类型</view>
				<view class="type-tag">电子合同</view>
			</view>

			<!-- 甲方信息 -->
			<view class="form-section">
				<view class="section-title">甲方（房东）信息</view>
				<view class="form-item">
					<text class="label required">姓名</text>
					<text class="value">刘帅</text>
				</view>
				<view class="form-item">
					<text class="label required">身份证号</text>
					<text class="value">21288812928773</text>
				</view>
				<view class="form-item">
					<text class="label required">手机号</text>
					<text class="value">1627837</text>
				</view>
			</view>

			<!-- 房屋地址 -->
			<view class="form-section">
				<view class="form-item">
					<text class="label required">房屋地址</text>
					<text class="value">北京市恒大龙奥御苑102</text>
				</view>
			</view>

			<!-- 乙方信息 -->
			<view class="form-section">
				<view class="section-title">乙方（租户）信息</view>
				<view class="form-item">
					<text class="label required">姓名</text>
					<input class="input" placeholder="请填写" placeholder-style="color: #999" />
				</view>
				<view class="form-item">
					<text class="label required">身份证号</text>
					<input class="input" placeholder="请填写" placeholder-style="color: #999" />
				</view>
				<view class="form-item">
					<text class="label required">手机号</text>
					<input class="input" placeholder="请填写" placeholder-style="color: #999" />
				</view>
			</view>
		</view>

		<!-- 底部按钮 -->
		<view class="bottom-btn" @click="handleNext">下一步</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			form: {
				name: "",
				idCard: "",
				phone: "",
			},
		};
	},
	methods: {
		handleNext() {
			// 这里可以添加表单验证逻辑
			uni.navigateTo({
				url: '/pages-lease/contract/contract-step2'
			})
		}
	}
};
</script>

<style lang="less" scoped>
.container {
	min-height: 100vh;
	background: #f5f6fa;
}

.nav-right {
	font-size: 28rpx;
	color: #2979ff;
	padding: 0 32rpx;
}

.form-content {
	padding: 24rpx;
}
.form-title {
	background: #fff;
	border-radius: 12rpx;
	padding: 24rpx;
	margin-bottom: 24rpx;
	display: flex;
	justify-content: space-between;
	.title {
		font-size: 28rpx;
		color: #333;
	}
	.type-tag {
		width: 112rpx;
		height: 40rpx;
		background: rgba(0, 149, 248, 0.06);
		border-radius: 8rpx;
		border: 1rpx solid #0095f8;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		font-size: 22rpx;
		color: #0095f8;
		text-align: center;
		line-height: 40rpx;
	}
}
.form-section {
	background: #fff;
	border-radius: 12rpx;
	padding: 24rpx;
	margin-bottom: 24rpx;
	display: flex;
	flex-direction: column;
	.section-title {
		font-size: 28rpx;
		color: #333;
		margin-bottom: 24rpx;
	}

	.form-item {
		display: flex;
		align-items: center;
		min-height: 88rpx;
        justify-content: space-between;
		border-bottom: 2rpx solid #f5f5f5;

		&:last-child {
			border-bottom: none;
		}

		.label {
			width: 160rpx;
			font-size: 28rpx;
			color: rgba(102, 102, 102, 1);

			&.required::after {
				content: "*";
				color: #ff5a5f;
				margin-left: 4rpx;
			}
		}

		.value {
			flex: 1;
			font-size: 28rpx;
			color: rgba(34, 34, 34, 1);
            text-align: right;
		}

		.input {
            text-align: right;
			flex: 1;
			font-size: 28rpx;
			color: #333;
		}
	}
}

.bottom-btn {
	position: fixed;
	left: 24rpx;
	right: 24rpx;
	bottom: calc(24rpx + env(safe-area-inset-bottom));
	height: 88rpx;
	line-height: 88rpx;
	text-align: center;
	background: #2979ff;
	border-radius: 44rpx;
	color: #fff;
	font-size: 32rpx;
}
</style>
